import { ADD, SUB } from '../constant';

export const add = (data) => ({ type: ADD, data})

export const sub = (data) => ({ type: SUB, data})

//异步返回函数
export const addAsync = (data, time) => {
  return (dispatch) => {
    setTimeout(() => {
      dispatch(add(data))
    }, time);
  }
}